<template>
  <div id="app">
    <!--内容-->
    <keep-alive>
      <router-view class="view-router" v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view class="view-router" v-if="!$route.meta.keepAlive"></router-view>

    <!--底部-->
    <router-view name="bottomTab"></router-view>
  </div>
</template>

<script>
  export default {
    name: 'App',
    mounted () {
      const script = document.createElement('script')
      script.src = 'https://s95.cnzz.com/z_stat.php?id=1276659655&web_id=1276659655';
      script.language = 'JavaScript'
      document.body.appendChild(script)
    },
    watch: {
      '$route' () {
        if (window._czc) {
          let location = window.location
          let contentUrl = location.pathname + location.hash
          let refererUrl = '/';
          window._czc.push(['_trackPageview', contentUrl, refererUrl])
          window._czc.push(["_setAccount", "1276659655"]); // 多个cnzz统计需要把账号添加上去，在统计事件之前，这里只有一个，统一设置就好
        }
      }
    }

  }
</script>

<style>

  html {
    -webkit-overflow-scrolling: touch;
    overflow-y: hidden;
  }

  /*这个配合mixin的scroll-fixed.js，记录滚动条的位置*/
  .view-router {
    height: 100vh;
    overflow-y: auto;
    /*box-sizing: border-box;*/
    /*padding-bottom: 50px;*/
  }
</style>
